/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.tencent.tendon.convert.json;

import java.lang.reflect.Type;

/**
 *
 * @author nbzhang
 */
public final class JsonField {

	private String name;

	private String alias = "";

	private boolean ignore;

	private JsonListener listener;

	private boolean indirect;

	private Type type;

	public JsonField(String name) {
		this.name = name;
	}

	public JsonField(String name, String alias) {
		this.name = name;
		this.alias = alias;
	}

	public JsonField(String name, boolean ignore) {
		this.name = name;
		this.ignore = ignore;
	}

	public JsonField(String name, Type type) {
		this.name = name;
		this.type = type;
	}

	public JsonField(String name, JsonListener listener) {
		this.name = name;
		this.listener = listener;
	}

	@Override
	public String toString() {
		return JsonField.class.getSimpleName() + "[name=" + name + ", alias=" + alias + ",ignore=" + ignore + ",indirect=" + indirect + ",listener=" + listener + ",type=" + type + "]";
	}

	public String alias() {
		return alias;
	}

	public void setAlias(String alias) {
		this.alias = alias;
	}

	public boolean ignore() {
		return ignore;
	}

	public void setIgnore(boolean ignore) {
		this.ignore = ignore;
	}

	public JsonListener listener() {
		return listener;
	}

	public void setListener(JsonListener listener) {
		this.listener = listener;
	}

	public boolean indirect() {
		return indirect;
	}

	public void setIndirect(boolean indirect) {
		this.indirect = indirect;
	}

	public Type type() {
		return type;
	}

	public void setType(Type type) {
		this.type = type;
	}

	public String name() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
}
